#if !defined(_Burger_p_)
#define _Burger_p_
#include <string>
#include <src/miscellaneous/OS_basic.h>
#include <src/math/Operators/delta_particle.h>
#include <src/math/BoundaryCondition/ClassicalGraphDefinition.h>

template <class A>
class Burger_p
	: public Delta_p<A>
{
public :
		enum:std::size_t												{Order = 1};
		typedef Burger_p												type;
		typedef Delta_p<A>										Base;
		typedef typename Base::Base_Cast								Base_Cast;
		typedef typename Base::result_type								result_type;
		typedef typename Base::argument_type							argument_type;
		typedef typename Base::smart_ptr_type							smart_ptr_type;

		Burger_p( ) {};
		Burger_p(const Burger_p & data) : Base(data) {};
		virtual ~Burger_p(){};
		static std::string get_name(){return " delta_y S + h delta_{S}u ";};
		Burger_p(const Base_Cast &first) : size_(0), Base(first)
		{};
		Burger_p & operator = (const Burger_p & from) {
			Base::operator =(from);
			return *this;
		};
		virtual result_type operator()(typename argument_type from) const 
		{
			std::size_t size(from.size());
			if (size >0)
				return ( (from<<1) - from )*size + (1./( from-(from>>1)) + 1./( from-(from<<1)) )/size;
			return result_type();
		};
		virtual smart_ptr_type Create_Instance() const {
			return Create_Instance_helper<type>();
		};
};


template <class data, typename Time = OS_double >
struct Burger_p_t : public BindTimeOperator<Burger_p<data> ,Time > {

	typedef Burger_p_t														time_operator_type;
	typedef BindTimeOperator<time_operator_type ,Time >						Base;
};


#endif